#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iomanip>

using namespace std;
vector<string> vec;

int doit(int b, int e, int ind) {
  int moved = 0;
  while (b <= e && vec[b].size() <= ind) moved++, b++;
  if (b > e) return 0;

  int last = b;
  int res = 0;
  for (int i = b ; i <= e; ++i) {
    if (vec[i][ind] != vec[last][ind]) {
      res += doit(last, i-1, ind+1) + i-last;
      last = i;
    }
  }
  if (last == b && !moved) {
    if (ind == 0) res += e-b+1;
    res += doit(b, e, ind+1);
  } else {
    res += doit(last, e, ind+1) + e-last+1;
  }
  //cout << res << endl;
  return res;
}


int main() {
  int i,j ,k;
  int N;
  while (cin >> N) {
    vec.clear();
    for (i = 0; i < N; ++i) {string s; cin >> s; vec.push_back(s); }
    sort(vec.begin(), vec.end());
    printf("%.2lf\n", doit(0, N-1, 0) / (double) N);
  } return 0;
}

